package com.hhs.storage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hhs.storage.bean.BaseRole;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author shadow
 * @since 2018-09-29
 */
public interface BaseRoleService extends IService<BaseRole> {
    Map<String, Object> dele(String id) ;

    Map<String, Object> putMenus(String roleId, String menuIds);

    /**
     * @Author: HuangHaiShui
     * @Description: 根据用户的id获取用户角色数据
     * @Date: 16:27 2022/9/17
     * @return: null
     **/
    List<BaseRole>  getByUserId(String userId);
    /**
     * @Author: HuangHaiShui
     * @Description:判断是否拥有某个角色
     * @Date: 13:49 2022/12/12
     * @return: boolean
     **/
    boolean hasRole(String flag,String userId);

    /**
     * @Description:判断是否拥有某些角色
     * @param flags
     * @param userId
     * @return
     */
    public boolean hasRoles(String[] flags, String userId);

    /**
     * 判断用户是否只拥有某个角色
     * @param flag
     * @param userId
     * @return
     */
    public boolean hasOnlyRole(String flag, String userId);
    Map<String, Object> addOrEdit(BaseRole baseRole);
}
